QuickTime 3 Reference

| Previous | Chapter contents | Chapter top | Section top | Next |

Setting up an Effect Description

The first step is to provide an effect description. The code shown in Listing 20-7 is very similar to the code described in "Creating an Effect Description" .

Listing 7 Providing an effect description

{
    QTAtomContainermyEffectDesc = NULL;
    OSType          myType;
    OSErr           myErr = noErr;
    long            myLong;

    // Create a new, empty effect description
    myErr = QTNewAtomContainer(&myEffectDesc);

    // This example is an effect description for a SMPTE effect
    myType = OSTypeConst(`smpt');
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    kParameterWhatName,
                    kParameterWhatID,
                    0,
                    sizeof(myType),
                    &myType,
                    NULL);

    // Now reference the two sources to be used. These will not be items in an input map.
    // Instead the source names used will be resolved in the decompression sequence.
    myType = OSTypeConst(`srcA');
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    kEffectSourceName,
                    1,
                    0,
                    sizeof(myType),
                    &myType,
                    NULL);

    // Add the second source
    myType = OSTypeConst(`srcB');
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    kEffectSourceName,
                    2,
                    0,
                    sizeof(myType),
                    &myType,
                    NULL);

    // This example uses SMTPE effect number 74, so add a WipeID parameter with the value 74
    myLong = 74;
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    OSTypeConst(`wpID'),
                    1,
                    0,
                    sizeof(myLong),
                    &myLong,
                    NULL);
}

© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top | Next |